<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="../css/element.css" rel="stylesheet"/>
    <link href="../css/styleindex.css" rel="stylesheet"/>
    <style>

    </style>
</head>
<body style="background:#EFF0F4;">

  <div class="mui-content">
    <div id="vm" class="x-examok" v-cloak>
      <div class="x-header-g" id="header">
        <a class="x-header-arrow" @click="api.closeWin()"></a>
        <div class="x-header-t">值班计划检查-交接记录</div>
      </div>
      <!--  -->
      <div class="x-pro-list">
        <div class="x-pro-top">收市人员名单</div>
        <div class="x-pro-row" v-for="item in tabledata" :key="item.key">
          <div class="x-pro-label">{{item.title}}</div>
          <div class="x-pro-input">
            <el-select v-model="item.list" placeholder="请选择" multiple>
              <el-option
                v-for="item in persondata"
                :key="item.id"
                :label="item.username"
                :value="item.id">
              </el-option>
            </el-select>
          </div>
        </div>
      </div>
      <!--  -->
      <div class="x-pro-list">
        <div class="x-pro-top">交办事项</div>
        <div v-for="(item,index) in notedata" :key="item.key">
          <div class="x-pro-row">
            <div class="x-pro-input">
              <el-input placeholder="请输入" v-model="item.content" type="textarea" :rows="3"></el-input>
            </div>
          </div>
        </div>
      </div>
      <!--  -->

      <div v-if="notedata==''&&tabledata==''" class="x-nothing">暂无内容</div>
    </div>
  </div>

  <script type="text/javascript" src="../script/vue.js"></script>
  <script type="text/javascript" src="../script/element.js"></script>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/base.js"></script>
	<script>
apiready = function () {
    $api.fixStatusBar($api.byId('header'));
    var tmonth = api.pageParam.date;
    console.log(tmonth);

    //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          notedata:'',
          tabledata:'',
          persondata:'',
          thmonth:'',

        }
      },
      created:function() {
        var that=this;


      },
      mounted:function(){
        var that=this;
        that.thmonth = tmonth;
        that.getpersondata()
        that.backshow()

      },
      methods: {
        //回显
        backshow:function(){
          let that=this;
          api.ajax({
            url:baseurl+'api/duty/getHandover',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('apptoken'),
                date:that.thmonth,
                _ssid:$api.getStorage('jobid')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                that.tabledata = ret.data.area;
                if(ret.data.log!=''){
                  that.notedata = ret.data.log;
                }


              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
        //
        getpersondata:function(){
          let that=this;
          api.ajax({
            url:baseurl+'api/person/list',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('apptoken'),
                _ssid:$api.getStorage('jobid')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                that.persondata = ret.data.list;

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
      }
    })
	}


	</script>
</body>
</html>
